home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
trueSpace 7.6
/
tS761B8Std.exe
/
{app}
/
Scripts
/
ScriptCommands
/
CreateCamera.xml
next >
Wrap
Extensible Markup Language
|
2008-06-10
|
2KB
|
53 lines
<?xml version="1.0" encoding="utf-8" ?>
<SCRIPT Name="CreateCamera" Type="command" Description="create camera" GUID = "{93AB930B-8687-4268-BE7A-B5E0766BD1A1}">
<SCRIPT_CODE><![CDATA[
function Execute(ret)
{
var root = Space.CurrentScene();
// first create encapsulator node
encaps = Node.Create('{649B82DC-EFDC-4BB3-A511-1AB075F63DFF}', root);
encaps = Node.SafeRename(encaps,'Camera');
// create transform node
TransformNode = Node.Create('{B386099D-8ADA-4130-A0BC-7F7F75D437C9}', encaps);
Node.Value(TransformNode,'roll') = -133.995;
Node.Value(TransformNode,'pitch') = -35.731;
Node.Value(TransformNode,'yaw') = 29.416;
Node.Value(TransformNode,'tx') = -18.001;
Node.Value(TransformNode,'ty') = 17.719;
Node.Value(TransformNode,'tz') = 15.051;
// export matrix connector of the transform node
Node.ExportConnector(TransformNode, 'WldMatrix', '', 1, 1);
Node.ExportConnector(TransformNode, 'ObjMatrix', '', 1, 1);
// export translation - tx, ty, tz connectors of the transform node
// used by camera move toolcmd
Node.ExportConnector(TransformNode, 'tx', '', 1, 1);
Node.ExportConnector(TransformNode, 'ty', '', 1, 1);
Node.ExportConnector(TransformNode, 'tz', '', 1, 1);
// export translation - rx, ry, rz connectors of the transform node
// used by camera Rotate toolcmd
Node.ExportConnector(TransformNode, 'roll', '', 1, 1);
Node.ExportConnector(TransformNode, 'pitch', '', 1, 1);
Node.ExportConnector(TransformNode, 'yaw', '', 1, 1);
// Create D3D Camera node
CameraNode = Node.Create('{6E020E14-28D7-4615-9AD3-8F3067A464CD}', encaps);
Node.Value(CameraNode,'FOV') = 0.5;
// export FOV angle connector of the camera node
// used by camera FOV toolcmd
Node.ExportConnector(CameraNode, 'FOV', '', 1, 1);
// export D3D Camera connector
Node.ExportConnector(CameraNode, 'Camera', '', 1, 1);
encaps = Node.SafeRename(encaps, 'Camera1');
}
]]></SCRIPT_CODE>
</SCRIPT>